package com.yitong.equipment.entity.other

import android.os.Parcel
import android.os.Parcelable
import java.util.*

class SortBean() : Parcelable {
    var name: String? = null
    var tag: String? = null
    var isTitle = false
    var imgsrc: String? = null
    var titleName: String? = null
    var title: String? = null
    var categoryOneArray: ArrayList<CategoryOneArrayBean>? = null

    constructor(parcel: Parcel) : this() {
        name = parcel.readString()
        tag = parcel.readString()
        isTitle = parcel.readByte() != 0.toByte()
        imgsrc = parcel.readString()
        titleName = parcel.readString()
        title = parcel.readString()
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(name)
        parcel.writeString(tag)
        parcel.writeByte(if (isTitle) 1 else 0)
        parcel.writeString(imgsrc)
        parcel.writeString(titleName)
        parcel.writeString(title)
    }

    override fun describeContents(): Int {
        return 0
    }

    override fun toString(): String {
        return "SortBean(name=$name, tag=$tag, isTitle=$isTitle, imgsrc=$imgsrc, titleName=$titleName, title=$title, categoryOneArray=$categoryOneArray)"
    }

    companion object CREATOR : Parcelable.Creator<SortBean> {
        override fun createFromParcel(parcel: Parcel): SortBean {
            return SortBean(parcel)
        }

        override fun newArray(size: Int): Array<SortBean?> {
            return arrayOfNulls(size)
        }
    }


}